<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="Tiny"/>
    <meta name="baidu-site-verification" content="W6jNZMCChd"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>Tiny社区论坛</title>
    <link rel="stylesheet" th:href="@{/css/iconfont2.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/my.css}">
    <link rel="stylesheet" th:href="@{/css/nprogress.css}">
    <link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/3.3.5/css/bootstrap.min.css}"/>
    <script src="webjars/jquery/3.1.1/jquery.min.js" th:src="@{/webjars/jquery/3.1.1/jquery.min.js}"></script>
</head>
<style>
    .login_btn{cursor: pointer;}
    .swal-button {
        padding: 7px 19px;
        border-radius: 2px;
        background-color: #4962B3;
        font-size: 12px;
        border: 1px solid #3e549a;
        text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.3);
    }
    .nav-list {
        position: relative;
        background-color: #f6f9fa;
        border: 1px solid #e5e9ef;
        overflow: hidden;
        border-radius: 4px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
        padding-top: 6px;
    }
    .nav-list .item {
        width: 48px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        transition: background-color .3s,color .3s;
        cursor: pointer;
        -ms-user-select: none;
        user-select: none;
    }
    .host_name{
        font-size: 14px;display: inline-block;
        font-weight: normal;
        margin-top: 5px;
        padding: 5px;
        color: #333333;
    }
    .fly-signin-main {
        position: relative;
        height: 35px;
        padding: 20px 15px;
        text-align: center;
    }
    .fly-panel-title {
        position: relative;
        height: 50px;
        line-height: 50px;
        padding: 0 15px;
        border-bottom: 1px dotted #E9E9E9;
        color: #333;
        border-radius: 2px 2px 0 0;
        font-size: 14px;
    }
    .fly-mid {
        display: inline-block;
        height: 10px;
        width: 1px;
        margin: 0 10px;
        vertical-align: middle;
        background-color: #e2e2e2;
    }
    .layui-btn-danger {
        background-color: #FF5722!important;
    }
    .layui-btn {
        display: inline-block;
        height: 30px;
        line-height: 30px;
        padding: 0 18px;
        background-color: #009688;
        color: #fff;
        white-space: nowrap;
        text-align: center;
        font-size: 14px;
        border: none;
        border-radius: 2px;
        cursor: pointer;
    }
    .fly-panel {
        margin-bottom: 15px;
        margin-left: 0px;
        padding: 0px;
        border-radius: 2px;
        background-color: #fff;
        box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
    }
    .fly-panel-title {
        position: relative;
        height: 50px;
        line-height: 50px;
        padding: 0 15px;
        border-bottom: 1px dotted #E9E9E9;
        color: #333;
        border-radius: 2px 2px 0 0;
        font-size: 14px;
    }
    .fly-list-one dd {
        margin: 0 5px;
        line-height: 25px;
        white-space: nowrap;
        overflow: hidden;
        list-style: decimal-leading-zero inside;
        *list-style-type: decimal inside;
        color: #009E94;
    }
    dl {
        display: block;
        margin-block-start: 1em;
        margin-block-end: 1em;
        margin-inline-start: 0px;
        margin-inline-end: 0px;
    }
    .fly-list-one dd a {
        max-width: 80%;
        display: inline-block;
        margin-right: 5px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 14px;
        color: #333;
    }
    .fly-list-one dd span {
        font-size: 12px;
        color: #ccc;
    }
</style>

<body>
<!--引入导航条-->
<div th:insert="~{navbar :: navbar}"></div>

<!--返回顶部的位置-->
<div class="container">
	
    <ul class="list " id="types">
        <li class="active"><a id="category-0" th:href="@{/category=0}">综合</a></li>
        <li>
            <a id="1" th:href="@{/?category=1}">提问</a>
        </li>
        <li>
            <a id="2" th:href="@{/?category=2}">分享</a>
        </li>
        <li>
            <a id="3" th:href="@{/?category=3}">讨论</a>
        </li>
        <li>
            <a id="4" th:href="@{/?category=4}">建议</a>
        </li>
        <li>
            <a id="5" th:href="@{/?category=5}">BUG</a>
        </li>
        
    </ul>
</div>
<!--内容部分-->
<div class="container main">
	
    <div class="col-lg-9 col-md-12 col-sm-12 lefwrapper">
        <div>
            <h4><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;发现</h4>
        </div>
        <!--分类导航-->
        <ul class="nav nav-tabs " id="myTabs">
            <li class="active"><a id="ALL">全部</a></li>
            <li>
                <a id="VIEW_HOT">查看最多</a>
            </li>
            <li>
                <a id="LIKE_HOT">点赞最多</a>
            </li>
            <li>
                <a id="COMMENT_HOT">评论最多</a>
            </li>
            <li>
                <a id="WAIT_COMMENT">待回复</a>
            </li>
            <li>
                <a id="MONTH_HOT">月榜</a>
            </li>

            <li>
                <a id="WEEK_HOT">周榜</a>
            </li>


        </ul>
        <!--问题列表-->
        <div id="question_wrapper">
        </div>
        <div id="no_quetions" class="text-center" style="margin-top: 50px; display: none;">暂无更多</div>

        <ul style="margin-top: 30px!important;overflow: hidden;" id="page"></ul>
    </div>
    <!--右边内容--->
    <div class="col-lg-3 col-md-12 col-sm-12 rightwrapper">

        <!--轮播图广告-->
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <div class="carousel-inner" role="listbox">
                <div class="item  active">
                    <a href="http://www.0201999.com/" target="_blank">
                        <img th:src="@{/images/gxgx.png}" alt="...">
                        <div class="carousel-caption">
                        </div>
                    </a>
                </div>
                <div class="item"  th:each="ad:${#session.getAttribute('ITEM')}">
                    <a href="http://www.0201999.com/" target="_blank">
                        <img th:src="${ad.image}" alt="...">
                        <div class="carousel-caption">
                        </div>
                    </a>
                </div>

            </div>
        </div>
       <!--每日签到-->
        <div class="container-fluid" style="margin:0px;padding:0px;background-color: #fff;">
        <div class="fly-panel-title"> 签到<i class="fly-mid"></i>
            <span class="fly-signin-days"></span>
        </div>
            <div class="fly-panel-main fly-signin-main">
                <button   class="btn  layui-btn layui-btn-normal" id="signin">今日签到</button>
            </div>
        </div>
        <!--热门标签-->
        <div class="hot_tag_wrapper">
            <br>
            <small><span class="iconfont icon-remen" style="color:#f40;font-size: 20px;"></span>最热标签</small>
            <div style="padding: 5px 0px;" class="tag_wrapper col-lg-12 col-md-12 col-sm-12">
            </div>
        </div>

        <!--最新用户-->
        <lable><span style="font-size: 16px;margin-bottom: 10px;display: inline-block;"
                     class="iconfont icon-xin-yonghuguanli"></span>最近登录
        </lable>
        <ul id="userlist" class="list-group">
        </ul>


        <!--热门推荐-->
        <lable><span style="font-size: 20px;color: #f40;margin-bottom: 10px;display: inline-block;"
                     class="iconfont icon-tuijian"></span>热门推荐
        </lable>
        <ul class=" rightlist" id="recommend_wrapper" style="margin: 0px;padding: 0px;">
        </ul>
        最近更新
        <lable><span style="margin-top: 10px;font-size: 20px;color: #f4d03f;margin-bottom: 10px;display: inline-block;"
                     class="iconfont icon-zuijingengxin1"></span>最近更新
        </lable>
        <ul class="list-group rightlist" id="newquestions_wrapper" style="margin: 0px;padding: 0px;">
        </ul>


       
        <hr>
        
    </div>

</div>
<!--页尾-->
<div th:insert="~{footer :: footer}"></div>
<form id="search_form">
    <input type="hidden" name="tag" id="tag_param" th:value="${tag}">
    <input type="hidden" name="search" id="search_param" th:value="${search}">
    <input type="hidden" name="sortby" id="sortby_param" th:value="${sortby}">
    <input type="hidden" name="category" id="category_param" th:value="${category}">
</form>
</body>
<script th:src="@{/js/indexdata.js}"></script>
<script th:src="@{/layer/layer.js}"></script>
<script src="webjars/bootstrap/3.3.5/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/3.3.5/js/bootstrap.min.js}"></script>
<script th:src="@{/js/nprogress.js}"></script>
<script th:src="@{/js/bootstrap-page.js}"></script>
<script th:src="@{/js/sweetalert.min.js}"></script>
<script th:src="@{/js/register.js}"></script>
<script>
    $(function () {
        $('#myTabs a').click(function (e) {
            $("#sortby_param").attr("sortby", this.id);
            to_page(1);
            $(this).tab('show');
        });
        $("#types li a").click(function () {
            $("#tag_param").val("");
            $(".tagname").css({color: "#fff"})
            $("#category_param").val(this.id);
            to_page(1);
            $("#types li").removeClass("active");
            $($(this).parent()).addClass("active");
            return false;
        })
        $('.carousel').carousel({
            interval: 1900
        })
        //弹出登入框
        $('.login_btn').click(function () {
            $(".login_modal").modal("show");
            return false;
        });
        //验证用户是否签到
        $.get("/sigIned",{"time":new Date()},function (data) {
            if(data.extend.sigined=="1"){
                $("#signin").attr("disabled","disabled") ;
            }
        })
    })
    //签到
    $("#signin").click(function () {
        var btn= $(this);
       $.get("/sigIn",{"time":new Date()},function (data) {
          if(data.code==1000){
              //禁用按钮的状态

              btn.attr("disabled","disabled") ;
              swal("签到成功", "获得10积分", "success",
                  {
                      buttons: false,
                      timer: 2400,
                  });
          }else{
              layer.msg(data.message, {time: 2000, icon: 5, shift: 6}, function () {
              });
          }

       })
    });

    $("#dologin_btn").click(function () {
        var username=$("#login_username").val().trim();
        var password=$("#login_password").val().trim();
        var loginCode=$("#loginCode").val().trim();
        if(username==null||username==""){
            layer.msg("用户名不能为空", {time: 2000, icon: 5, shift: 6}, function () {
            });
            return false;
        }
        if(password==null||password==""){
            layer.msg("密码不能为空", {time: 2000, icon: 5, shift: 6}, function () {
            });
            return false;
        }
        if(loginCode==null||loginCode==""){
            layer.msg("验证码不能为空", {time: 2000, icon: 5, shift: 6}, function () {
            });
            return false;
        }
        $.post("/login",{"username":username,"password":password,"time":new Date(),"code":loginCode},function (data) {
            if(data.code==1000){
                swal("恭喜你已登录成功~", "稍作等待，正在努力跳转中~", "success",
                    {
                        buttons: false,
                        timer: 1000,
                    })
                    .then((value) => {
                    window.location.href="/";
            });
            }else {
                layer.msg(data.message, {time: 2000, icon: 5, shift: 6}, function () {
                });
            }
        })
    });
</script>
</html>

